<!-- templates/create_task.html -->
{% extends "base.html" %}
{% block title %}布置新任务{% endblock %}
{% block extra_css %}
<style>
    /* 修复卡片悬停效果 */
    .card-body {
        background: rgb(220, 220, 220)!important;
        border-radius: 24px;
        overflow: hidden; /* 确保内部内容圆角匹配 */
    }

</style>
{% endblock %}

{% block content %}
<div class="container mt-4">
    <div class="card-body">
        <div class="card-body">
            <h3 class="mb-4"><i class="fas fa-tasks me-2"></i>布置新任务</h3>
            {% if error %}
                <div class="alert alert-danger">{{ error }}</div>
            {% endif %}
            <form method="POST">
                <div class="mb-3">
                    <label class="form-label">任务标题</label>
                    <input type="text" name="title" class="form-control" required>
                </div>
                <div class="mb-3">
                    <label class="form-label">任务内容</label>
                    <textarea name="content" class="form-control" rows="6" required></textarea>
                </div>
                <div class="mb-3">
                    <label class="form-label">截止时间</label>
                    <input type="datetime-local" name="deadline" class="form-control" required>
                </div>
                <button type="submit" class="btn btn-primary">
                    <i class="fas fa-paper-plane me-2"></i>发布任务
                </button>
                <a href="{{ url_for('teacher_dashboard') }}" class="btn btn-secondary">
                    取消
                </a>
            </form>
        </div>
    </div>
</div>
{% endblock %}